package org.itheima.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface ShouCangMapper {

    @Select("select * from shoucangbiao where id=#{id}")
    List<Map<String,Object>> shouCangFindById(String id);

    @Insert("insert into shoucangbiao(name,id,oldPrice,image,tableId) values(#{name},#{id},#{oldPrice},#{image},#{tableId})")
    void addShouCang(String name, String id, String oldPrice,String image,int tableId);

    @Delete("delete from shoucangbiao where name=#{name} and id=#{id}")
    void deleteShouCang(String name, String id);

}
